import Vue from 'vue'
import VueRouter from 'vue-router'
import index from "../views/index"
import BookManager from "../views/BookManager";
import AddBook from "../views/AddBook";
import PageThree from "../views/PageThree";
import PageFour from "../views/PageFour";
import BookUpdate from "../views/BookUpdate";


Vue.use(VueRouter)

const routes = [
  {
    path: "/",
    name: "图书管理",
    component: index,
    redirect: "/BookManager",
    children: [
      {
        path: "/BookManager",
        name: "查询图书",
        show:true,
        component: BookManager
      },
      {
        path: "/AddBook",
        name: "添加图书",
        show:true,
        component: AddBook
      },
      {
        path: '/BookUpdate',
        name: "修改",
        show: false,
        component: BookUpdate,

      }
    ]
  }
  // {
  //   path: "/navigation",
  //   name: "导航2",
  //   component: index,
  //   show:true,
  //   children: [
  //     {
  //       path: "/BookUpdate",
  //       name: "修改",
  //       component: BookUpdate
  //     },
  //     {
  //       path: "/pageFour",
  //       name: "页面4",
  //       component: PageFour
  //     }
  //   ]
  // }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
